<template>
	<div>
		<div class="aui-pull-left">
			<label ><input class="aui-radio" :checked="item.defaultaddress == '默认'" @click.stop="setDefault" type="radio" name="demo1">&nbsp;默认地址</label>
		</div>
	</div>
</template>

<script>
	import {mapActions} from 'vuex';
	export default {
		props:{
			item: {
                type: Object,
                default:()=>{
                	return {}
                }
            },
            userInfomation: {
            	type: Object,
                default: ()=>{
                	return {}
                }
            },
            getstatusBtn: {
            	type: Function,
                default: () => {}
            }
		},
		data() {
			return {
				
			}
		},
		created(){
//			console.log(this.item,this.userInfomation,this.getstatusBtn,'9')
		},
		methods: {
			...mapActions('zx',[
				'setAddressInfo'
			]),
			setDefault() {
				let {defaultaddress,label,sex,...rest} = this.item
				
//				console.log(index,'this.userInfomation')
	            let userData = this.userInfomation
	            if(label == '家庭'){
	                label = '0'
	            }
	            if(label == '公司'){
	                label = '1'
	            }
	            if(label == '其他'){
	                label = '2'
	            }
	            if(sex == '男'){
	                sex = '0'
	            } else {
	                sex = '1'
	            }
	            let params = {
	                type : "UPDATE",
	                defaultaddress: '1',
	                addressid:this.item.addressid,
	                showToast:false
	            }
	            this.setAddressInfo(params);
			}
		}
	}
</script>

<style>
</style>